/*VaWVqaRPOcVLGQLUZRykSxN43lbEnxQvSuDfiMhf4NYKgvGSAU5ZxOpOA4snWHov*/
import React, { Component } from 'react';
import { createPage, base, ajax, createPageIcon,toast } from 'nc-lightapp-front';
import translateVO from './utils/translateVO';
import translateData from './utils/translateData';
const { NCToggleViewBtn, NCRadio, NCDiv } = base;
const { NCRadioGroup } = NCRadio;
import {
	initNewAssetTemplate,
	initEquipTemplate,
	initEquipMainTemplate,
	initPurTemplate,
	initPurMainTemplate,
	initProjectTemplate,
	initProjectMainTemplate,
	initProfitTemplate,
	initAllTemplate,
	initAlllMainTemplate,
	initNewAssetMainTemlate,
	initProfitMainTemplate,
	initContractMainTemplate,
	initContractTemplate,
	purAfterEvent,
	proAfterEvent,
	afterEvent,
	openmessage,
	orgAfterEvent4allTransfer,
	orgAfterEvent4assetTransfer,
	orgAfterEvent4profitTransfer,
	orgAfterEvent4contractTransfer,
	orgAfterEvent4proTransfer,
	orgAfterEvent4purTransfer,
	orgAfterEvent4equipTransfer
} from './events';
import {
	assetTransferSearch,
	assetTransferHead,
	assetTransferBody,
	assetMainTransferPageCode,
	equipTransferHead,
	equipTransferPageCode,
	equipTransferSearch,
	equipMainTransferPageCode,
	purTransferHead,
	purTransferBody,
	purTransferSearch,
	purMainTransferPageCode,
	proTransferHead,
	proTransferBody,
	proTransferSearch,
	profitTransferHead,
	profitTransferBody,
	profitMainTransferPageCode,
	proMainTransferPageCode,
	profitTransferSearch,
	contractTransferSearch,
	contractTransferHead,
	contractTransferBody,
	contractMainTransferPageCode,
	contractMainTransferId,
	allTransferHead,
	allTransferBody,
	allTransferSearch,
	allMainTransferPageCode,
	KeyMap,
	dataSource,
	tabInfoIndexMap
} from './constants';

import ampub from 'ampub';

const { components, utils } = ampub;
const { getThemeUtils, listUtils } = utils;
const { createListTitleArea, getTitleName } = listUtils;
const { getMultiLangByID } = utils.multiLangUtils;
const { setContext } = components.LoginContext;
const { ModuleEnable } = components;

import {
	purchase_btnClick,
	project_btnClick,
	selected_btnClick,
	all_btnClick,
	profit_btnClick,
	newasset_btnClick,
	equip_btnClick,
	contract_btnClick
} from './btnClick';
import './index.less';

// 参照过滤业务单元
const { components: { assetOrgMultiRefFilter: { isMultiCorpRefHandler, renderCompleteEvent } } } = ampub;

class AssetTransfer extends Component {
	constructor(props) {
		super(props);

		props.use.search(
			allTransferSearch,
			assetTransferSearch,
			equipTransferSearch,
			purTransferSearch,
			proTransferSearch,
			profitTransferSearch,
			contractTransferSearch
		);

		this.initPurTemplate = initPurTemplate.bind(this);
		this.initPurMainTemplate = initPurMainTemplate.bind(this);
		this.initProjectTemplate = initProjectTemplate.bind(this);
		this.initProjectMainTemplate = initProjectMainTemplate.bind(this);
		this.initContractMainTemplate = initContractMainTemplate.bind(this);
		this.initContractTemplate = initContractTemplate.bind(this);

		this.state = {
			pro_cardStyle: '0',
			pur_cardStyle: '0',
			activeSearchId: allTransferSearch, //当前选中页签的查询区ID
			tabActiveIndex: '0' //当前选中得页签 index
		};

		this.updateDataFn = () => {}; //消息打开的表体数据更新函数，在初始化模板的回调中使用

		//采购转固建卡方式
		this.pur_cardStyle_arr = [
			{ name: getMultiLangByID('201201512A-000049'), value: '0' },
			{ name: getMultiLangByID('201201512A-000050'), value: '2' },
			{ name: getMultiLangByID('201201512A-000051'), value: '3' }
		];
		//工程转固建卡方式
		this.pro_cardStyle_arr = [
			{ name: getMultiLangByID('201201512A-000049'), value: '0' },
			{ name: getMultiLangByID('201201512A-000052'), value: '1' },
			{ name: getMultiLangByID('201201512A-000050'), value: '2' }
		];
		this.isAIMEnable = 'uninitialized';
		this.isALIEnable = 'uninitialized';
	}

	componentWillMount() {
		openmessage.call(this);
	}

	componentDidMount() {}

	handlePurCardStyleChange = (value) => {
		this.setState({
			pur_cardStyle: value
		});
	};

	handleProCardStyleChange = (value) => {
		this.setState({
			pro_cardStyle: value
		});
	};

	clickTab = (key, callback = () => {}) => {
		//页签切换 事件
		//点击页签的钩子函数
		let isNeedLoadMaster = false; //是否加载主子模板
		this.setState({ tabActiveIndex: key }, () => {
			let isFlagView = this.props.transferTable.getCurrentTransferTableStatus(
				'showFullTable',
				tabInfoIndexMap[key].head,
				dataSource
			);
			let meta = this.props.meta.getMeta();
			//当前处于拉平状态，需要同时加载主子模板（因为拉平模板上没有查询区）
			if (isFlagView && !meta[tabInfoIndexMap[key].head]) {
				isNeedLoadMaster = true;
			}
			if (isNeedLoadMaster) {
				this.loadMeta.call(this, false);
			}
			this.loadMeta.call(this, isFlagView);
			this.state.activeSearchId = tabInfoIndexMap[key].search;
			callback();
		});
	};

	/**
	 * 加载 template
	 * @param isFlagView 是否为拉平模板
	 */
	loadMeta = (isFlagView) => {
		let meta = this.props.meta.getMeta();
		// 返回当前选中的页签
		//let tabActiveIndex = this.props.transferTable.getCurrentTransferTableStatus('activeTab', null, dataSource);
		let tabActiveIndex = this.state.tabActiveIndex;
		// 获取主子拉平状态
		/*let isFlagView = this.props.transferTable.getCurrentTransferTableStatus(
			'showFullTable',
			tabInfoIndexMap[tabActiveIndex + ''].head,
			dataSource
		);*/
		let _this = this;
		switch (tabActiveIndex) {
			case '0': //全部
				isFlagView
					? meta[allMainTransferPageCode] || initAlllMainTemplate(this.props)
					: meta[allTransferHead] || initAllTemplate(this.props);
				break;

			case '1': //新增资产审批单
				isFlagView
					? meta[assetMainTransferPageCode] || initNewAssetMainTemlate(this.props)
					: meta[assetTransferHead] || initNewAssetTemplate(this.props);
				break;

			case '2': //资产卡片
				// 判断资产模块是否启用
				if (this.isAIMEnable === 'uninitialized') {
					this.isAIMEnable = ModuleEnable.MODULEENABLE.isAIMEnabled();
				}
				if (!this.isAIMEnable) {
					return;
				}
				isFlagView
					? meta[equipMainTransferPageCode] || initEquipMainTemplate(this.props)
					: meta[equipTransferHead] || initEquipTemplate(this.props);
				break;

			case '3': //采购转固
				isFlagView
					? meta[purMainTransferPageCode] || this.initPurMainTemplate(this.props)
					: meta[purTransferHead] || this.initPurTemplate(this.props);
				break;

			case '4': //工程转固
				isFlagView
					? meta[proMainTransferPageCode] || this.initProjectMainTemplate(this.props)
					: meta[proTransferHead] || this.initProjectTemplate(this.props);
				break;

			case '5': //盘盈
				isFlagView
					? meta[profitMainTransferPageCode] || initProfitMainTemplate(this.props)
					: meta[profitTransferHead] || initProfitTemplate(this.props);
				break;

			case '6': //资产租入

				// 判断资产租入模块是否启用
				if (this.isALIEnable === 'uninitialized') {
					this.isALIEnable = ModuleEnable.MODULEENABLE.isALIEnabled();
				}
				if (!this.isALIEnable) {
					toast({ color: 'warning', content: getMultiLangByID('201201512A-000056') /* 国际化处理： 资产租入模块未启用！*/ });
					return;
				}

				isFlagView
					? meta[contractMainTransferPageCode] || this.initContractMainTemplate(this.props)
					: meta[contractTransferHead] || this.initContractTemplate(this.props);
				break;
		}
	};

	render() {
		const { transferTable, search } = this.props;
		const { NCCreateSearch } = search;
		const { createMultiTransferTable } = transferTable;

		console.log('transferTable =============== ', transferTable);

		let selectedShow = transferTable.getSelectedListDisplay('all');
		return (
			<div id="transferList" className="nc-bill-list">
				{!selectedShow ? (
					<NCDiv className="nc-bill-header-area">
						{/* 标题区 */}
						<div className="header-title-search-area">
							{createListTitleArea.call(this, this.props, { title: getTitleName(this.props) })}
						</div>

						<div className="header-button-area">
							{/* 列设置 平台去掉了 */}
							{/* <NCSetColBtn onClick={this.handleClick} /> */}
							<NCToggleViewBtn
								expand={false}
								onClick={() => {
									this.props.transferTable.changeViewType();
									let isFlagView = this.props.transferTable.getCurrentTransferTableStatus(
										'showFullTable',
										tabInfoIndexMap[this.state.tabActiveIndex].head,
										dataSource
									);
									this.loadMeta.call(this, isFlagView);
								}}
							/>
						</div>
					</NCDiv>
				) : (
					''
				)}
				<div className="tabsInfo">
					{/* 创建多来源转单 */}
					{createMultiTransferTable(
						{
							dataSource: dataSource,
							onTabClick: this.clickTab,
							showAll: true, //是否显示全部页签，不显示全部页签时不需要设置 默认为false
							//==========以下参数必须设置showAll为true时才生效==========
							allHeadId: 'all_head', //全部页签的主表id
							allBodyId: 'all_body', //全部页签的子表id
							allFullTableId: allMainTransferPageCode,
							headPkIds: [ 'pk_newasset', 'pk_equip', 'pk_transasset', 'pk_profit', 'pk_contract' ],
							bodyPkIds: [ 'pk_newasset_b', 'pk_equip', 'pk_transasset_b', 'pk_profit_b', 'pk_contract_eq' ],
							transferBtnText: getMultiLangByID('201201512A-000044'), //转单按钮显示文字
							containerSelector: '#transferList', //容器的选择器 必须唯一,用于设置底部已选区域宽度
							tabActiveIndex: this.state.tabActiveIndex,

							onTransferBtnClick: () => {
								//点击转单按钮钩子函数
								//将已选数据转化为转单后台所需结构
								let selectdata = this.props.transferTable.getTransferTableSelectedValue();
								//全选
								let destAllDatas = selectdata[allTransferHead];
								let other = [];
								//新增资产审批单
								let newasset_billtype = {
									bill_type: { value: 'HN', display: getMultiLangByID('201201512A-000033') }
								};
								let destNewAssetDatas = translateData(
									selectdata[assetTransferHead],
									assetTransferHead,
									assetTransferBody,
									allTransferHead,
									allTransferBody,
									KeyMap.KeyMapNewToAll,
									newasset_billtype
								);
								other.push(...destNewAssetDatas);
								//设备卡片
								let equip_billtype = {
									bill_type: { value: '4A00', display: getMultiLangByID('201201512A-000032') }
								};
								let destEquipDatas = translateData(
									selectdata[equipTransferHead],
									equipTransferHead,
									null,
									allTransferHead,
									allTransferBody,
									KeyMap.KeyMapEquipToAll,
									equip_billtype
								);
								other.push(...destEquipDatas);
								//采购转固单
								let purject_billtype = {
									bill_type: { value: 'HJ-02', display: getMultiLangByID('201201512A-000034') }
								};
								let destPurjectDatas = translateData(
									selectdata[purTransferHead],
									purTransferHead,
									purTransferBody,
									allTransferHead,
									allTransferBody,
									KeyMap.KeyMapPurToAll,
									purject_billtype
								);
								other.push(...destPurjectDatas);
								//工程转固单
								let project_billtype = {
									bill_type: { value: 'HJ-01', display: getMultiLangByID('201201512A-000035') }
								};
								let destProjectDatas = translateData(
									selectdata[proTransferHead],
									proTransferHead,
									proTransferBody,
									allTransferHead,
									allTransferBody,
									KeyMap.KeyMapProToAll,
									project_billtype
								);
								other.push(...destProjectDatas);
								//盘盈
								let profit_billtype = {
									bill_type: { value: 'HS', display: getMultiLangByID('201201512A-000038') }
								};
								let destProfitDatas = translateData(
									selectdata[profitTransferHead],
									profitTransferHead,
									profitTransferBody,
									allTransferHead,
									allTransferBody,
									KeyMap.KeyMapProfitToAll,
									profit_billtype
								);
								other.push(...destProfitDatas);
								//资产租入
								let contract_billtype = {
									bill_type: { value: '4A3A', display: getMultiLangByID('201201512A-000055') }
								};
								let destContractDatas = translateData(
									selectdata[contractTransferHead],
									contractTransferHead,
									contractTransferBody,
									allTransferHead,
									allTransferBody,
									KeyMap.KeyMapContractToAll,
									contract_billtype
								);
								other.push(...destContractDatas);

								//过滤全部页签和其他页签重复数据
								let newDestAllDatas = destAllDatas.filter((item) => {
									let key = item.head[allTransferHead].rows[0].values.pk.value;
									let flag = true;
									other.map((otherItem) => {
										let otherKey = otherItem.head[allTransferHead].rows[0].values.pk.value;
										if (otherKey === key) {
											flag = false;
											let bodyRows = item.body[allTransferBody].rows;
											let newBodyRows = [];
											for (let i = 0; i < bodyRows.length; i++) {
												let bodyflag = true;
												for (let j = 0; j < otherItem.body[allTransferBody].rows.length; j++) {
													let otherbodykey =
														otherItem.body[allTransferBody].rows[i].values.pk_b.value;
													if (otherbodykey == bodyRows[i].values.pk_b.value) {
														bodyflag = false;
													}
												}
												if (bodyflag) {
													newBodyRows.push(bodyRows[i]);
												}
											}
											otherItem.body[allTransferBody].rows.push(...newBodyRows);
										}
									});
									return flag;
								});
								//将过滤后的全部页签数据重新和其他页签数据组装组装
								let finalData = [];
								if (newDestAllDatas) {
									finalData.push(...newDestAllDatas);
								}
								finalData.push(...other);
								//将前台数据转为后台所需数据
								let param = translateVO(
									finalData,
									allTransferHead,
									allTransferBody,
									this.state.pur_cardStyle,
									this.state.pro_cardStyle
								);
								//处理转固单建卡方式
								let proArray = [];
								let purArray = [];
								param.map((item) => {
									if (item.sourceBillType === 'HJ-01') {
										proArray.push(item.sourceHeadPk);
									}
									if (item.sourceBillType === 'HJ-02') {
										purArray.push(item.sourceHeadPk);
									}
								});

								let style = {};
								if (this.state.pro_cardStyle === this.state.pur_cardStyle) {
									proArray.push(...purArray);
									purArray = [];
								}
								if (proArray.length > 0) {
									style[this.state.pro_cardStyle] = proArray;
								}
								if (purArray.length > 0) {
									style[this.state.pur_cardStyle] = purArray;
								}

								if (Object.keys(style).length > 0) {
									let styleParam = {
										msgMap: style
									};
									ajax({
										url: '/nccloud/fa/transasset/createCardStyle.do',
										data: styleParam,
										success: (res) => {
											setContext.call(
												this,
												'multiSource_for_facard',
												JSON.stringify(param),
												dataSource
											);

											//点击转单按钮钩子函数
											this.props.pushTo('/dest', {
												pagecode: '201201512A_card'
											});
										}
									});
								} else {
									setContext.call(this, 'multiSource_for_facard', JSON.stringify(param), dataSource);

									//点击转单按钮钩子函数
									this.props.pushTo('/dest', {
										pagecode: '201201512A_card'
									});
								}
							},
							//查看已选
							onSelectedBtnClick: selected_btnClick.bind(this),
							onChangeViewClick: () => {
								//点击切换视图钩子函数
								if (!this.props.meta.getMeta()[allMainTransferPageCode]) {
									initAlllMainTemplate(this.props); //加载主子拉平模板
								}
								this.props.transferTable.changeViewType(allTransferHead);
							},
							selectArea: () => {
								return <span />;
							},

							onClearAll: () => {},
							onSelectedItemRemove: (record, bodys) => {}
						},
						[
							{
								tabName: getMultiLangByID('201201512A-000045'), //tab页签显示文字【全部】
								headTableId: allTransferHead, //表格组件id
								bodyTableId: allTransferBody,
								fullTableId: allMainTransferPageCode,
								searchArea: () => {
									//查询区域render
									return NCCreateSearch(allTransferSearch, {
										fieldid: 'allTransfer',
										/*用于解决 F3 快捷键弹出查询，切换页签后不能正常关闭的问题 */
										currentSearch: this.state.activeSearchId === allTransferSearch,
										clickSearchBtn: all_btnClick.bind(this, this.isRefAddLine, this.billvo),
										// 查询区渲染后：主组织关联参照字段控制其业务单元是否显示
										renderCompleteEvent: renderCompleteEvent.bind(
											this,
											this.props,
											allTransferSearch,
											'pk_org',
											orgAfterEvent4allTransfer.bind(this)
										),
										// 优先级低于clickAdvBtnEve
										statusChangeEvent: renderCompleteEvent.bind(
											this,
											this.props,
											allTransferSearch,
											'pk_org',
											orgAfterEvent4allTransfer.bind(this)
										)
									});
								},
								onCheckedChange: (flag, record, index, bodys) => {},
								onChangeViewClick: () => {
									//点击切换视图钩子函数
									if (!this.props.meta.getMeta()[allMainTransferPageCode]) {
										initAlllMainTemplate(this.props); //加载主子拉平模板
									}
									this.props.transferTable.changeViewType(allTransferHead);
								}
							},
							{
								tabName: getMultiLangByID('201201512A-000033'), //tab页签显示文字【新增资产审批单】
								headTableId: assetTransferHead, //表格组件id
								bodyTableId: assetTransferBody, //子表模板id
								fullTableId: assetMainTransferPageCode,
								searchArea: () => {
									//查询区域render
									return NCCreateSearch(assetTransferSearch, {
										fieldid: 'assetTransfer',
										currentSearch: this.state.activeSearchId === assetTransferSearch,
										onAfterEvent: afterEvent.bind(this),
										clickSearchBtn: newasset_btnClick.bind(this, this.isRefAddLine, this.billvo),
                                        // 查询区渲染后：主组织关联参照字段控制其业务单元是否显示
										renderCompleteEvent: renderCompleteEvent.bind(
											this,
											this.props,
											assetTransferSearch,
											'pk_org',
											orgAfterEvent4assetTransfer.bind(this)
										),
										// 优先级低于clickAdvBtnEve
										statusChangeEvent: renderCompleteEvent.bind(
											this,
											this.props,
											assetTransferSearch,
											'pk_org',
											orgAfterEvent4assetTransfer.bind(this)
										)
									});
								},
								onCheckedChange: (flag, record, index, bodys) => {},
								onChangeViewClick: () => {
									//点击切换视图钩子函数
									if (!this.props.meta.getMeta()[assetMainTransferPageCode]) {
										initNewAssetMainTemlate(this.props); //加载主子拉平模板
									}
									this.props.transferTable.changeViewType(assetTransferHead);
								}
							},
							{
								tabName: getMultiLangByID('201201512A-000046'), //tab页签显示文字【资产卡片】
								headTableId: equipTransferHead, //表格组件id
								// bodyTableId: equipTransferBody, //表格组件id
								fullTableId: equipMainTransferPageCode,
								searchArea: () => {
									//查询区域render;
									return NCCreateSearch(equipTransferSearch, {
										fieldid: 'equipTransfer',
										currentSearch: this.state.activeSearchId === equipTransferSearch,
										clickSearchBtn: equip_btnClick.bind(this, this.isRefAddLine, this.billvo),
                                        // 查询区渲染后：主组织关联参照字段控制其业务单元是否显示
										renderCompleteEvent: renderCompleteEvent.bind(
											this,
											this.props,
											equipTransferSearch,
											'pk_org_fi',
											orgAfterEvent4equipTransfer.bind(this)
										),
										// 优先级低于clickAdvBtnEve
										statusChangeEvent: renderCompleteEvent.bind(
											this,
											this.props,
											equipTransferSearch,
											'pk_org_fi',
											orgAfterEvent4equipTransfer.bind(this)
										)
									});
								},
								onCheckedChange: (flag, record, index, bodys) => {},
								onChangeViewClick: () => {
									//点击切换视图钩子函数
									if (!this.props.meta.getMeta()[equipMainTransferPageCode]) {
										initEquipTemplate(this.props); //加载主子拉平模板
									}
									this.props.transferTable.changeViewType(equipTransferHead);
								}
							},
							{
								tabName: getMultiLangByID('201201512A-000034'), //tab页签显示文字【采购转固单】
								headTableId: purTransferHead, //表格组件id
								bodyTableId: purTransferBody,
								fullTableId: purMainTransferPageCode,
								searchArea: () => {
									//查询区域render
									return (
										<div>
											<div>
												{NCCreateSearch(purTransferSearch, {
													fieldid: 'purTransfer',
													currentSearch: this.state.activeSearchId === purTransferSearch,
													onAfterEvent: purAfterEvent.bind(this),
													clickSearchBtn: purchase_btnClick.bind(
														this,
														this.isRefAddLine,
														this.billvo
													),
                                                    // 查询区渲染后：主组织关联参照字段控制其业务单元是否显示
                                                    renderCompleteEvent: renderCompleteEvent.bind(
                                                        this,
                                                        this.props,
                                                        purTransferSearch,
                                                        'pk_org',
                                                        orgAfterEvent4purTransfer.bind(this)
                                                    ),
                                                    // 优先级低于clickAdvBtnEve
                                                    statusChangeEvent: renderCompleteEvent.bind(
                                                        this,
                                                        this.props,
                                                        purTransferSearch,
                                                        'pk_org',
                                                        orgAfterEvent4purTransfer.bind(this)
                                                    )
                                                })}
											</div>
											<br />
											<div className={`fa-transfer-createStyle ${getThemeUtils() + 'theme'}`}>
												{getMultiLangByID('201201512A-000048')}：
												<NCRadioGroup
													name="pur_cardStyle"
													selectedValue={this.state.pur_cardStyle}
													onChange={(value) => {
														this.handlePurCardStyleChange.call(this, value);
													}}
												>
													{this.pur_cardStyle_arr.map((item) => {
														return <NCRadio value={item.value}>{item.name}</NCRadio>;
													})}
												</NCRadioGroup>
											</div>
											<br />
										</div>
									);
								},
								onCheckedChange: (flag, record, index, bodys) => {},
								onChangeViewClick: () => {
									//点击切换视图钩子函数
									if (!this.props.meta.getMeta()[purMainTransferPageCode]) {
										initPurMainTemplate(this.props); //加载主子拉平模板
									}
									this.props.transferTable.changeViewType(purTransferHead);
								}
							},
							{
								tabName: getMultiLangByID('201201512A-000035'), //tab页签显示文字 【工程转固单】
								headTableId: proTransferHead, //表格组件id
								bodyTableId: proTransferBody,
								fullTableId: proMainTransferPageCode,
								searchArea: () => {
									//查询区域render
									return (
										<div>
											<div>
												{NCCreateSearch(proTransferSearch, {
													fieldid: 'proTransfer',
													currentSearch: this.state.activeSearchId === proTransferSearch,
													onAfterEvent: proAfterEvent.bind(this),
													clickSearchBtn: project_btnClick.bind(
														this,
														this.isRefAddLine,
														this.billvo
													),
                                                    // 查询区渲染后：主组织关联参照字段控制其业务单元是否显示
                                                    renderCompleteEvent: renderCompleteEvent.bind(
                                                        this,
                                                        this.props,
                                                        proTransferSearch,
                                                        'pk_org',
                                                        orgAfterEvent4proTransfer.bind(this)
                                                    ),
                                                    // 优先级低于clickAdvBtnEve
                                                    statusChangeEvent: renderCompleteEvent.bind(
                                                        this,
                                                        this.props,
                                                        proTransferSearch,
                                                        'pk_org',
                                                        orgAfterEvent4proTransfer.bind(this)
                                                    )
												})}
											</div>
											<br />
											<div className={`fa-transfer-createStyle  ${getThemeUtils() + 'theme'}`}>
												{getMultiLangByID('201201512A-000048')}：
												<NCRadioGroup
													name="pur_cardStyle"
													selectedValue={this.state.pro_cardStyle}
													onChange={(value) => {
														this.handleProCardStyleChange.call(this, value);
													}}
												>
													{this.pro_cardStyle_arr.map((item) => {
														return <NCRadio value={item.value}>{item.name}</NCRadio>;
													})}
												</NCRadioGroup>
											</div>
											<br />
										</div>
									);
								},
								onCheckedChange: (flag, record, index, bodys) => {},
								onChangeViewClick: () => {
									//点击切换视图钩子函数
									if (!this.props.meta.getMeta()[proMainTransferPageCode]) {
										initProjectMainTemplate(this.props); //加载主子拉平模板
									}
									this.props.transferTable.changeViewType(proTransferHead);
								}
							},
							{
								tabName: getMultiLangByID('201201512A-000038'), //tab页签显示文字 【盘盈】
								headTableId: profitTransferHead, //表格组件id
								bodyTableId: profitTransferBody,
								fullTableId: profitMainTransferPageCode,
								searchArea: () => {
									//查询区域render
									return NCCreateSearch(profitTransferSearch, {
										fieldid: 'profitTransfer',
										currentSearch: this.state.activeSearchId === profitTransferSearch,
										onAfterEvent: afterEvent.bind(this),
										clickSearchBtn: profit_btnClick.bind(this, this.isRefAddLine, this.billvo),
                                        // 查询区渲染后：主组织关联参照字段控制其业务单元是否显示
                                        renderCompleteEvent: renderCompleteEvent.bind(
                                            this,
                                            this.props,
                                            profitTransferSearch,
                                            'pk_org',
                                            orgAfterEvent4profitTransfer.bind(this)
                                        ),
                                        // 优先级低于clickAdvBtnEve
                                        statusChangeEvent: renderCompleteEvent.bind(
                                            this,
                                            this.props,
                                            profitTransferSearch,
                                            'pk_org',
                                            orgAfterEvent4profitTransfer.bind(this)
                                        )
									});
								},
								onCheckedChange: (flag, record, index, bodys) => {},
								onChangeViewClick: () => {
									//点击切换视图钩子函数
									if (!this.props.meta.getMeta()[profitMainTransferPageCode]) {
										initProfitMainTemplate(this.props); //加载主子拉平模板
									}
									this.props.transferTable.changeViewType(profitTransferHead);
								}
							},
							{
								tabName: getMultiLangByID('201201512A-000055'), //tab页签显示文字 【资产租入】
								headTableId: contractTransferHead, //表格组件id
								bodyTableId: contractTransferBody,
								fullTableId: contractMainTransferId,
								searchArea: () => {
									//查询区域render
									return NCCreateSearch(contractTransferSearch, {
										fieldid: 'contractTransfer',
										currentSearch: this.state.activeSearchId === contractTransferSearch,
										onAfterEvent: afterEvent.bind(this),
										clickSearchBtn: contract_btnClick.bind(this, this.isRefAddLine, this.billvo),
                                        // 查询区渲染后：主组织关联参照字段控制其业务单元是否显示
                                        renderCompleteEvent: renderCompleteEvent.bind(
                                            this,
                                            this.props,
                                            contractTransferSearch,
                                            'pk_fiorg_in',
                                            orgAfterEvent4contractTransfer.bind(this)
                                        ),
                                        // 优先级低于clickAdvBtnEve
                                        statusChangeEvent: renderCompleteEvent.bind(
                                            this,
                                            this.props,
                                            contractTransferSearch,
                                            'pk_fiorg_in',
                                            orgAfterEvent4contractTransfer.bind(this)
                                        )
									});
								},
								onCheckedChange: (flag, record, index, bodys) => {},
								onChangeViewClick: () => {
									//点击切换视图钩子函数
									if (!this.props.meta.getMeta()[contractMainTransferPageCode]) {
										initContractMainTemplate(this.props); //加载主子拉平模板
									}
									this.props.transferTable.changeViewType(contractTransferHead);
								}
							}
						]
					)}
				</div>
			</div>
		);
	}
}

AssetTransfer = createPage({
	initTemplate: initAllTemplate
})(AssetTransfer);

export default AssetTransfer;

/*VaWVqaRPOcVLGQLUZRykSxN43lbEnxQvSuDfiMhf4NYKgvGSAU5ZxOpOA4snWHov*/